package com.net.oil.news.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.news.bean.NewsListBean;
import com.net.oil.news.contract.NewsListContract;
import com.net.oil.news.model.NewsListModel;

/**
 * 作者：lch
 * 时间：2018/3/15:10:20
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class NewsListPresenter extends BasePresenter<NewsListContract.View> implements NewsListContract.Presenter {

    private NewsListContract.View view;
    private NewsListContract.Model model;

    public NewsListPresenter(NewsListContract.View view) {
        this.view = view;
        this.model = new NewsListModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getNewsList(int categoryId, int page, int rows) {
        model.getNewsList(categoryId, page, rows);
    }

    @Override
    public void getNewsListSuccess(NewsListBean newsListBean) {
        view.getNewsListSuccess(newsListBean);
    }

    @Override
    public void getNewsListFailed() {
        view.getNewsListFailed();
    }
}
